// components/system/expert_information/expert_information.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        // 本人信息
        realName: '',
        qualification1: '',
        qualification2: '',
        qualification3: '',
        introduce: '',

        //专家列表
    },

    /**
     * 组件的方法列表
     */
    methods: {
        onReachBottom(){
            console.log("专家信息下拉触底")
        },

        //获取本人信息
        getExpert() {
            let id = wx.getStorageSync('userId')
            wx.request({
                url: `http://120.77.156.205:8808/wx/expert/getExpert/${id}`,
                method: 'GET',
                success: (res) => {
                    // console.log(res)
                    let resData = res.data.data.expert
                    this.setData({
                        realName: resData.realName,
                        qualification1: resData.qualification1,
                        qualification2: resData.qualification2,
                        qualification3: resData.qualification3,
                        introduce: resData.introduce,
                    })
                },
                fail: (err) => {
                    wx.showToast({
                        title: '请求服务器资源失败！',
                        icon: 'none'
                    })
                }
            })
        }
    },

    lifetimes: {
        attached() {
            //个人专家信息
            this.getExpert()
        }
    }
})
